PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Appearance Manager >

Programming With the Appearance Manager


DrawThemeFocusRect

Draws or erases a focus ring around a specified rectangle.

pascal OSStatus DrawThemeFocusRect (
                     const Rect *inRect,
                     Boolean inHasFocus);
inRect
A pointer to a structure of type Rect . Before calling DrawThemeFocusRect , set the rectangle to the position around which to draw the focus ring, in local coordinates. The focus ring is drawn outside the rectangle that is passed in, and it can be outset a maximum of 3 pixels.
inHasFocus
A value of type Boolean . Pass true to draw the focus ring. Pass false to erase the focus ring.
function result
A result code; see Result Codes .
DISCUSSION

Your application can use the DrawThemeFocusRect function to draw a theme-compliant focus ring. The presence of a focus ring indicates whether an item has keyboard focus.

SPECIAL CONSIDERATIONS

If you are drawing a focus ring around an element for which you have drawn a frame using DrawThemeEditTextFrame or DrawThemeListBoxFrame , you must coordinate your drawing sequence to achieve the correct look. When drawing the element, your application should first call DrawThemeEditTextFrame or DrawThemeListBoxFrame and then call DrawThemeFocusRect , passing the same rectangle in the inRect parameter. If you use DrawThemeFocusRect to erase the focus ring around an editable text frame or list box frame, you must redraw the editable text frame or list box frame after calling DrawThemeFocusRect , because there is typically an overlap.

VERSION NOTES

Available with Appearance Manager 1.0 and later.


© 1999 Apple Computer, Inc. – (Last Updated 29 April 99)